package com.itheima005;

public class Person {
    private String name;
    private int age;
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void raise(Animal animal, String something) {
        System.out.println(getAge()+getName());
        if(animal instanceof Dog d){
            System.out.println(d.getAge()+" "+d.getColor()+"狗");
        }else{
            System.out.println(animal.getAge()+animal.getColor()+"猫");
        }
        animal.eat(something);
    }

    public Person() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
